﻿using System;
using System.Windows.Forms;
using UniMana.Data;

namespace UniMana.Win.Personnel
{
    public partial class FrmCheckSubjectClass_LecturerAll_EditComment : DevExpress.XtraEditors.XtraForm
    {
        Training_Session_Subject_Class_RoomInfo tsessioninfo;

        public FrmCheckSubjectClass_LecturerAll_EditComment(Training_Session_Subject_Class_RoomInfo tsessioninfo)
        {
            InitializeComponent();
            //tsessioninfo = new Training_Session_Subject_Class_RoomInfo();
            this.tsessioninfo = tsessioninfo;
        }

        private void FrmCheckSubjectClass_LecturerAll_EditComment_Load(object sender, EventArgs e)
        {
            rtbNote.Text = tsessioninfo.Properties.Note;
        }

        private void rtbNote_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (tsessioninfo.Properties.Note != rtbNote.Text)
                    {
                        tsessioninfo.Properties.Note = rtbNote.Text;
                        tsessioninfo.Save();
                        ClsPublic._flagLoadMarkNote = true;
                    }
                    this.Close();
                }
            }
            catch { this.Close(); }
        }
    }
}
